<?php
	require('config.php');
    $order_id=$_REQUEST['order_id'];
    $user_id=$_REQUEST['user_id'];
    $sql="select ".$oto."_help_orders.*,".$oto."_help.title,".$oto."_help.content from ".$oto."_help_orders,".$oto."_help where ".$oto."_help_orders.id='{$order_id}' and ".$oto."_help_orders.helpId=".$oto."_help.id";
	$result=$db->query($sql);
	while($row=$result->fetch_assoc()){
		$order[]=$row;//将取得的所有数据赋值给person_info数组
	}
	if(isset($order))
	{
		$for_user_id=$order[0]['acceptUserId'];
		$sql="select userName from ".$oto."_users where userId='{$for_user_id}'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$user_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($user_info))
		{
			$order[0]['userName']=$user_info[0]['userName'];
		}
		else $order[0]['userName']="";
		if($order[0]['userId']==$user_id) $lin_user_id=$order[0]['acceptUserId'];
		else if($order[0]['acceptUserId']==$user_id) $lin_user_id=$order[0]['userId'];
		$sql="select userName from ".$oto."_users where userId='{$lin_user_id}'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$user_info2[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($user_info2))
		{
			$order[0]['to_userName']=$user_info2[0]['userName'];
		}
		else $order[0]['to_userName']="";
		$wb_id=$order[0]['helpId'];
		$sql="select * from ".$oto."_help_star where helpId='{$wb_id}' and userId='{$user_id}' and isDel='0'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$pingjia[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($pingjia))
		{
			$order[0]['isPj']=1;
		}
		else
		{
			$order[0]['isPj']=0;
		}
		$sql="select * from `".$oto."_suggest` where userId='{$user_id}' and `object`='{$wb_id}'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$suggest[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($suggest))
		{
			$order[0]['isTs']=1;
		}
		else
		{
			$order[0]['isTs']=0;
		}
		echo json_encode($order);
	}
	else echo "[]";
?>